package com.iflytek.hive.need7;


import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class MaxDayReducer extends Reducer<DayAmountBean, NullWritable, Text, DayAmountBean> {
    private final Text keyout = new Text();
    @Override
    protected void reduce(DayAmountBean key, Iterable<NullWritable> values, Context context)throws IOException, InterruptedException {
        keyout.set(key.getDate().substring(0,4));
        context.write(keyout, key);
    }
}
